﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;

public class Building : Unit
{
    public Building() : base()
    {
        price = 20;
    }

    public override void BeAttacked(int att)
    {
        if (currentHP <= 0)
        {
            isDisplayBlood = false;
            return;
        }

        // 不死且受伤情况血条显示
        if (currentHP < 100)
        {
            isDisplayBlood = true;
        }


        //if (!GameObject.Find("") .chargeServer)
        //    return;

        currentHP -= att;
        if (currentHP <= 0)
        {
            currentHP = 0;
            DestroyObject(gameObject);
        }
    }

}
